<template>
    <div class="refund-select">
        <div class="row">
            <p>仅退款</p>
            <svg class="icon" :class="{active:firstActive}" aria-hidden="true" @click="refund">
                <use xlink:href="#icon-selected"></use>
            </svg>
        </div>
        <div class="row">
            <p>退货退款</p>
            <svg class="icon" :class="{active:!firstActive}" aria-hidden="true" @click="refundGoods">
                <use xlink:href="#icon-selected"></use>
            </svg>
        </div>
        <contact-service :has-right="false"></contact-service>
        <p class="tips">线上商城商品 退款不退邮费</p>
        <div class="btn">
            <div class="commit" @click="next">下一步</div>
        </div>
    </div>
</template>

<script type="text/ecmascript-6">
    import ContactService from "../../../components/User/contact-service";

    export default {
        components: {ContactService},
        name: 'refund-select',
        data() {
            return {
                firstActive:false
            };
        },
        methods:{
            refund() {
                this.firstActive = true;
            },
            refundGoods() {
                this.firstActive = false;
            },
            next(){
                let data = this.$route.query;
                if(this.firstActive){
                    // 跳转至仅退款
                    data.refundType = '0';// 仅退款0/退款退货1
                    this.$router.replace({
                        name: 'online-refund',
                        query:data
                    })
                }else{
                    // 跳转至退货退款
                    data.refundType = '1';// 仅退款0/退款退货1
                    this.$router.replace({
                        name: 'online-refund',
                        query:data
                    })

                }
            }
        }
    };
</script>

<style lang="stylus" rel="stylesheet/stylus" scoped>
    @import '~assets/main.styl';

    .refund-select {
        overflow-x hidden
        word-vw(word14, gray3)
        .row {
            flex-x()
            padding: 0 cellPadding
            height vw(45)
            background grayF
            margin-bottom 1px
            .active{
                fill: main-color
            }
        }
        .tips{
            text-align center
            word-vw(vw(12), gray9)
            margin-top vw(10)
        }
        .btn{
            width 100%
            height vw(55)
            background grayF
            position absolute
            bottom 0
            display flex
            justify-content center
            align-items center
            .commit {
                big-solid();
                height vw(35)
                display flex
                justify-content center
                align-items center
            }
        }
    }
</style>